import { createApp } from "vue"
import App from "./App.vue"
import router from "./router"
import store from "./store"
import ElementPlus from "element-plus"
import "element-plus/dist/index.css"

// 彻底隐藏 ResizeObserver loop completed with undelivered notifications 报错和警告（仅开发环境）
if (process.env.NODE_ENV === 'development') {
  const observerErr = 'ResizeObserver loop completed with undelivered notifications.'
  window.addEventListener('error', e => {
    if (e.message === observerErr) {
      e.stopImmediatePropagation()
      return false
    }
  })
  // 彻底隐藏控制台警告
  const realWarn = console.warn
  console.warn = function (...args) {
    if (
      typeof args[0] === 'string' &&
      args[0].includes('ResizeObserver loop completed with undelivered notifications')
    ) {
      return
    }
    realWarn.apply(console, args)
  }
}

createApp(App).use(store).use(router).use(ElementPlus).mount("#app")
